<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="en">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="mysql," />










<meta name="description" content="windows 中安装 mysql-8.0.14 步骤记录下载mysql 安装包 解压并进入安装目录&amp;lt;img src=&amp;quot;&#x2F;assets&#x2F;imgages&#x2F;2019&#x2F;01290002.png&amp;quot;&amp;gt;配置path环境变量MYSQL_HOME：mysql安装路径 &amp;lt;img src=&amp;quot;&#x2F;assets&#x2F;imgages&#x2F;2019&#x2F;01290003.png&amp;quot;&amp;">
<meta name="keywords" content="mysql">
<meta property="og:type" content="article">
<meta property="og:title" content="windows中安装mysql-8.0.14">
<meta property="og:url" content="https:&#x2F;&#x2F;longxiaowei.github.io&#x2F;2019&#x2F;01&#x2F;29&#x2F;mysql&#x2F;index.html">
<meta property="og:site_name" content="Longxw">
<meta property="og:description" content="windows 中安装 mysql-8.0.14 步骤记录下载mysql 安装包 解压并进入安装目录&amp;lt;img src=&amp;quot;&#x2F;assets&#x2F;imgages&#x2F;2019&#x2F;01290002.png&amp;quot;&amp;gt;配置path环境变量MYSQL_HOME：mysql安装路径 &amp;lt;img src=&amp;quot;&#x2F;assets&#x2F;imgages&#x2F;2019&#x2F;01290003.png&amp;quot;&amp;">
<meta property="og:locale" content="en">
<meta property="og:image" content="https:&#x2F;&#x2F;longxiaowei.github.io&#x2F;images&#x2F;mysql&#x2F;1.png">
<meta property="og:updated_time" content="2020-03-18T08:21:55.025Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https:&#x2F;&#x2F;longxiaowei.github.io&#x2F;images&#x2F;mysql&#x2F;1.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://longxiaowei.github.io/2019/01/29/mysql/"/>





  <title>windows中安装mysql-8.0.14 | Longxw</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="en">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Longxw</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://longxiaowei.github.io/2019/01/29/mysql/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="longxiaowei">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Longxw">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">windows中安装mysql-8.0.14</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2019-01-29T00:00:00+08:00">
                2019-01-29
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">In</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/database/" itemprop="url" rel="index">
                    <span itemprop="name">database</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="windows-中安装-mysql-8-0-14-步骤记录"><a href="#windows-中安装-mysql-8-0-14-步骤记录" class="headerlink" title="windows 中安装 mysql-8.0.14 步骤记录"></a>windows 中安装 mysql-8.0.14 步骤记录</h1><h2 id="下载mysql-安装包"><a href="#下载mysql-安装包" class="headerlink" title="下载mysql 安装包"></a>下载mysql 安装包</h2><p><img src="/images/mysql/1.png" alt=""></p>
<h2 id="解压并进入安装目录"><a href="#解压并进入安装目录" class="headerlink" title="解压并进入安装目录"></a>解压并进入安装目录</h2><pre><code>&lt;img src=&quot;/assets/imgages/2019/01290002.png&quot;&gt;</code></pre><h2 id="配置path环境变量"><a href="#配置path环境变量" class="headerlink" title="配置path环境变量"></a>配置path环境变量</h2><pre><code>MYSQL_HOME：mysql安装路径
&lt;img src=&quot;/assets/imgages/2019/01290003.png&quot;&gt;
PATH:%MYSQL_HOME%\bin
&lt;img src=&quot;/assets/imgages/2019/01290004.png&quot;&gt;</code></pre><h2 id="初始化服务信息"><a href="#初始化服务信息" class="headerlink" title="初始化服务信息"></a>初始化服务信息</h2><pre><code>- 在mysql安装目录下 即bin文件夹同级 新建 data文件夹和my.ini文件,my.ini内容如下，用window记事本打开保存，ANSI编码。

    &lt;pre&gt;
    [mysqld]
    # 设置3306端口
    port=3306

    # 设置mysql的安装目录
    basedir=D:/mysql-8.0.14

    # 设置mysql数据库的数据的存放目录
    datadir=D:/mysql-8.0.14/data
    # 允许最大连接数

    max_connections=200
    # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
    max_connect_errors=10
    # 服务端使用的字符集默认为UTF8
    character-set-server=utf8
    # 创建新表时将使用的默认存储引擎
    default-storage-engine=INNODB
    [mysql]
    # 设置mysql客户端默认字符集
    default-character-set=utf8mb4
    [client]
    # 设置mysql客户端连接服务端时默认使用的端口
    port=3306
    default-character-set=utf8
    &lt;/pre&gt;

- 以管理员的身份打开cmd窗口 初始化服务：

mysqld --initialize --user=mysql --console

初始化完成之后，会生成一个临时密码,将此密码复制保存

&lt;img src=&quot;/assets/imgages/2019/01290005.png&quot;&gt;</code></pre><h2 id="安装服务"><a href="#安装服务" class="headerlink" title="安装服务"></a>安装服务</h2><pre><code>mysqld -install</code></pre><h2 id="启动服务"><a href="#启动服务" class="headerlink" title="启动服务"></a>启动服务</h2><pre><code>net start mysql

&lt;img src=&quot;/assets/imgages/2019/01290006.png&quot;&gt;</code></pre><h2 id="修改密码"><a href="#修改密码" class="headerlink" title="修改密码"></a>修改密码</h2><pre><code>mysql -u root -p登录数据库 输入上面的临时密码

ALTER USER root@localhost IDENTIFIED  BY &apos;123456&apos;; 将密码为123456</code></pre>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/mysql/" rel="tag"># mysql</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/01/29/index/" rel="next" title="隆孝伟的博客">
                <i class="fa fa-chevron-left"></i> 隆孝伟的博客
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/01/29/pdm/" rel="prev" title="从数据库中生成pdm">
                从数据库中生成pdm <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
  <div id="gitalk-container"></div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            Overview
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">longxiaowei</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/%7C%7Carchive">
              
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">categories</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">9</span>
                  <span class="site-state-item-name">tags</span>
                </a>
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#windows-中安装-mysql-8-0-14-步骤记录"><span class="nav-number">1.</span> <span class="nav-text">windows 中安装 mysql-8.0.14 步骤记录</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#下载mysql-安装包"><span class="nav-number">1.1.</span> <span class="nav-text">下载mysql 安装包</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#解压并进入安装目录"><span class="nav-number">1.2.</span> <span class="nav-text">解压并进入安装目录</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#配置path环境变量"><span class="nav-number">1.3.</span> <span class="nav-text">配置path环境变量</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#初始化服务信息"><span class="nav-number">1.4.</span> <span class="nav-text">初始化服务信息</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装服务"><span class="nav-number">1.5.</span> <span class="nav-text">安装服务</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#启动服务"><span class="nav-number">1.6.</span> <span class="nav-text">启动服务</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#修改密码"><span class="nav-number">1.7.</span> <span class="nav-text">修改密码</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">longxiaowei</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
  <script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
  <div id="gitalk-container"></div>
  <script type="text/javascript">
    var gitalk = new Gitalk({
      clientID: '5431b0eabc608f2fe7e9',
      clientSecret: '064ebe3895d7759300adf5dbb806c2fe80426547',
      repo: 'blog-talk',
      owner: 'longxiaowei',
      admin: ['longxiaowei'],
      id: location.pathname,
      distractionFreeMode: 'false'
    })
    gitalk.render('gitalk-container')
  </script>


  





  

  

  

  
  

  

  

  

</body>
</html>
